﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using Microsoft.VisualStudio.Shell;
using AxlfVSX.Core;
using EnvDTE;
using Aoxuelf.MDSTool.UI;

namespace Aoxuelf.MDSTool.Commands
{
    [CommandID(GuidList.guidMDSToolCmdSetString, PkgCmdIDList.cmdidInsertBLLUpdate)]
    public class InsertBLLUpdateCommand : DynamicCommand
    {
        public InsertBLLUpdateCommand(Package package)
            : base(package)
        {
        }

        protected override bool CanExecute(OleMenuCommand command)
        {
            try
            {
                return FileCodeModelHelper.IsServceClass(Dte);
            }
            catch
            {
                return false;
            }            
        }

        protected override void OnExecute(OleMenuCommand command)
        {
            InsertBLLUpdateForm form = new InsertBLLUpdateForm();
            form.ViewModel = new ViewModel.InsertBLLUpdateViewModel { MethodName = "SaveXX", Summary = "保存"};
            form.ShowDialog();
        }
    }
}
